package itheima_Integer;

import java.util.Arrays;

public class Sort {
    public static void main(String[] args) {


        int[] arr = {9, 8, 5, 7, 6, 4, 2, 3,22,13,24,35,53};

        Sort(arr);

    }

    private static void Sort(int[] arr) {

        for (int i = 0; i < arr.length - 1; i++) {
            boolean tmp = true;
            for (int i1 = 0; i1 < arr.length - 1  - i; i1++) {
                if (arr[i1] > arr[i1 + 1]) {
                    int num = arr[i1];
                    arr[i1] = arr[i1 + 1];
                    arr[i1 + 1] = num;
                    tmp = false;
                }
            }
            System.out.println(Arrays.toString(arr));
            if(tmp){
                return;
            }
        }


    }
}
